#!/usr/bin/env python3
# Author: Armit
# Create Time: 周五 2025/08/22 

# 跑测试集，产生提交文件 (目前是假的)

import random
import librosa as L

from utils import *


def get_wav_similarity(anc_wav_fp:str, com_wav_fp:str) -> float:
  return random.random()  # > 0.5
  return 0                # = 0.5


def run():
  items = load_testset_index_file()
  preds = []
  for anc_wav_fp, com_wav_fp in items:
    pred = get_wav_similarity(anc_wav_fp, com_wav_fp)
    pred = round(pred, 5)
    preds.append((Path(anc_wav_fp).name, pred))

  save_fp = SUBMIT_PATH / 'dummy.csv'
  write_submit_file(save_fp, preds)


if __name__ == '__main__':
  cwd = os.getcwd()
  os.chdir(TEST_PATH)
  try:
    run()
  finally:
    os.chdir(cwd)
